1 + 100
2^2
7/2
4-1
2*2
3 + 5*2
(3+5)*2
2e2
2/100000
sin(1)
log(1)
exp(0)
1 == 1
1 >= 1
1 < 1
1 != 2
x <- 10
x <- 10
x
x + x
x - 5
x^2
y <- x + x
y
1:5
2^(1:5)
v <- 1:5
2^v
log10(v)
installed.packages()
Package LibPath
askpass "askpass" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
base "base" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
base64enc "base64enc" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
boot "boot" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
bslib "bslib" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
cachem "cachem" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
class "class" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
cluster "cluster" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
codetools "codetools" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
compiler "compiler" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
curl "curl" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
datasets "datasets" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
digest "digest" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
evaluate "evaluate" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
fastmap "fastmap" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
foreign "foreign" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
fs "fs" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
glue "glue" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
graphics "graphics" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
grDevices "grDevices" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
grid "grid" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
highr "highr" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
htmltools "htmltools" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
jquerylib "jquerylib" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
jsonlite "jsonlite" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
KernSmooth "KernSmooth" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
knitr "knitr" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
lattice "lattice" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
magrittr "magrittr" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
markdown "markdown" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
MASS "MASS" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
Matrix "Matrix" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
memoise "memoise" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
methods "methods" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
mgcv "mgcv" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
mime "mime" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
nlme "nlme" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
nnet "nnet" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
openssl "openssl" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
packrat "packrat" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
parallel "parallel" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
permute "permute" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
R6 "R6" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
rappdirs "rappdirs" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
rlang "rlang" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
rmarkdown "rmarkdown" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
rpart "rpart" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
rsconnect "rsconnect" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
rstudioapi "rstudioapi" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
sass "sass" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
spatial "spatial" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
splines "splines" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
stats "stats" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
stats4 "stats4" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
stringi "stringi" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
stringr "stringr" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
survival "survival" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
sys "sys" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
tcltk "tcltk" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
tinytex "tinytex" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
tools "tools" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
utils "utils" "/Library/Frameworks/R.framework/Versions/4.2/Resources/library"
Version Priority Depends
askpass "1.1" NA NA
base "4.2.1" "base" NA
base64enc "0.1-3" NA "R (>= 2.9.0)"
boot "1.3-28" "recommended" "R (>= 3.0.0), graphics, stats"
bslib "0.4.0" NA "R (>= 2.10)"
cachem "1.0.6" NA NA
class "7.3-20" "recommended" "R (>= 3.0.0), stats, utils"
cluster "2.1.3" "recommended" "R (>= 3.5.0)"
codetools "0.2-18" "recommended" "R (>= 2.1)"
compiler "4.2.1" "base" NA
curl "4.3.2" NA "R (>= 3.0.0)"
datasets "4.2.1" "base" NA
digest "0.6.29" NA "R (>= 3.3.0)"
evaluate "0.16" NA "R (>= 3.0.2)"
fastmap "1.1.0" NA NA
foreign "0.8-82" "recommended" "R (>= 4.0.0)"
fs "1.5.2" NA "R (>= 3.1)"
glue "1.6.2" NA "R (>= 3.4)"
graphics "4.2.1" "base" NA
grDevices "4.2.1" "base" NA
grid "4.2.1" "base" NA
highr "0.9" NA "R (>= 3.2.3)"
htmltools "0.5.3" NA "R (>= 2.14.1)"
jquerylib "0.1.4" NA NA
jsonlite "1.8.0" NA "methods"
KernSmooth "2.23-20" "recommended" "R (>= 2.5.0), stats"
knitr "1.40" NA "R (>= 3.3.0)"
lattice "0.20-45" "recommended" "R (>= 3.0.0)"
magrittr "2.0.3" NA "R (>= 3.4.0)"
markdown "1.1" NA "R (>= 2.11.1)"
MASS "7.3-57" "recommended" "R (>= 3.3.0), grDevices, graphics, stats, utils"
Matrix "1.4-1" "recommended" "R (>= 3.5.0)"
memoise "2.0.1" NA NA
methods "4.2.1" "base" NA
mgcv "1.8-40" "recommended" "R (>= 3.6.0), nlme (>= 3.1-64)"
mime "0.12" NA NA
nlme "3.1-157" "recommended" "R (>= 3.5.0)"
nnet "7.3-17" "recommended" "R (>= 3.0.0), stats, utils"
openssl "2.0.3" NA NA
packrat "0.8.1" NA "R (>= 3.0.0)"
parallel "4.2.1" "base" NA
permute "0.9-7" NA "R (>= 2.14.0)"
R6 "2.5.1" NA "R (>= 3.0)"
rappdirs "0.3.3" NA "R (>= 3.2)"
rlang "1.0.6" NA "R (>= 3.4.0)"
rmarkdown "2.16" NA "R (>= 3.0)"
rpart "4.1.16" "recommended" "R (>= 2.15.0), graphics, stats, grDevices"
rsconnect "0.8.27" NA "R (>= 3.0.0)"
rstudioapi "0.14" NA NA
sass "0.4.2" NA NA
spatial "7.3-15" "recommended" "R (>= 3.0.0), graphics, stats, utils"
splines "4.2.1" "base" NA
stats "4.2.1" "base" NA
stats4 "4.2.1" "base" NA
stringi "1.7.8" NA "R (>= 3.1)"
stringr "1.4.1" NA "R (>= 3.1)"
survival "3.3-1" "recommended" "R (>= 3.5.0)"
sys "3.4" NA NA
tcltk "4.2.1" "base" NA
tinytex "0.42" NA NA
tools "4.2.1" "base" NA
utils "4.2.1" "base" NA
Imports
askpass "sys (>= 2.1)"
base NA
base64enc NA
boot NA
bslib "grDevices, htmltools (>= 0.5.2), jsonlite, sass (>= 0.4.0),\njquerylib (>= 0.1.3), rlang, cachem, memoise"
cachem "rlang, fastmap"
class "MASS"
cluster "graphics, grDevices, stats, utils"
codetools NA
compiler NA
curl NA
datasets NA
digest "utils"
evaluate "methods"
fastmap NA
foreign "methods, utils, stats"
fs "methods"
glue "methods"
graphics "grDevices"
grDevices NA
grid "grDevices, utils"
highr "xfun (>= 0.18)"
htmltools "utils, digest, grDevices, base64enc, rlang (>= 0.4.10),\nfastmap (>= 1.1.0)"
jquerylib "htmltools"
jsonlite NA
KernSmooth NA
knitr "evaluate (>= 0.15), highr, methods, stringr (>= 0.6), yaml (>=\n2.1.19), xfun (>= 0.29), tools"
lattice "grid, grDevices, graphics, stats, utils"
magrittr NA
markdown "utils, xfun, mime (>= 0.3)"
MASS "methods"
Matrix "methods, graphics, grid, stats, utils, lattice"
memoise "rlang (>= 0.4.10), cachem"
methods "utils, stats"
mgcv "methods, stats, graphics, Matrix, splines, utils"
mime "tools"
nlme "graphics, stats, utils, lattice"
nnet NA
openssl "askpass"
packrat "tools, utils"
parallel "tools, compiler"
permute "stats"
R6 NA
rappdirs NA
rlang "utils"
rmarkdown "bslib (>= 0.2.5.1), evaluate (>= 0.13), htmltools (>= 0.5.1),\njquerylib, jsonlite, knitr (>= 1.22), methods, stringr (>=\n1.2.0), tinytex (>= 0.31), tools, utils, xfun (>= 0.30), yaml\n(>= 2.1.19)"
rpart NA
rsconnect "curl, digest, jsonlite, openssl (>= 2.0.0), packrat (>= 0.6),\nrstudioapi (>= 0.5), tools, yaml (>= 2.1.5)"
rstudioapi NA
sass "fs, rlang (>= 0.4.10), htmltools (>= 0.5.1), R6, rappdirs"
spatial NA
splines "graphics, stats"
stats "utils, grDevices, graphics"
stats4 "graphics, methods, stats"
stringi "tools, utils, stats"
stringr "glue (>= 1.2.0), magrittr, stringi (>= 1.1.7)"
survival "graphics, Matrix, methods, splines, stats, utils"
sys NA
tcltk "utils"
tinytex "xfun (>= 0.29)"
tools NA
utils NA
LinkingTo
askpass NA
base NA
base64enc NA
boot NA
bslib NA
cachem NA
class NA
cluster NA
codetools NA
compiler NA
curl NA
datasets NA
digest NA
evaluate NA
fastmap NA
foreign NA
fs NA
glue NA
graphics NA
grDevices NA
grid NA
highr NA
htmltools NA
jquerylib NA
jsonlite NA
KernSmooth NA
knitr NA
lattice NA
magrittr NA
markdown NA
MASS NA
Matrix NA
memoise NA
methods NA
mgcv NA
mime NA
nlme NA
nnet NA
openssl NA
packrat NA
parallel NA
permute NA
R6 NA
rappdirs NA
rlang NA
rmarkdown NA
rpart NA
rsconnect NA
rstudioapi NA
sass NA
spatial NA
splines NA
stats NA
stats4 NA
stringi NA
stringr NA
survival NA
sys NA
tcltk NA
tinytex NA
tools NA
utils NA
Suggests
askpass "testthat"
base "methods"
base64enc NA
boot "MASS, survival"
bslib "shiny (>= 1.6.0), rmarkdown (>= 2.7), thematic, knitr,\ntestthat, withr, rappdirs, curl, magrittr"
cachem "testthat"
class NA
cluster "MASS, Matrix"
codetools NA
compiler NA
curl "spelling, testthat (>= 1.0.0), knitr, jsonlite, rmarkdown,\nmagrittr, httpuv (>= 1.4.4), webutils"
datasets NA
digest "tinytest, simplermarkdown"
evaluate "covr, ggplot2, lattice, testthat"
fastmap "testthat (>= 2.1.1)"
foreign NA
fs "testthat, covr, pillar (>= 1.0.0), tibble (>= 1.1.0), crayon,\nrmarkdown, knitr, withr, spelling, vctrs (>= 0.3.0)"
glue "covr, crayon, DBI, dplyr, forcats, ggplot2, knitr, magrittr,\nmicrobenchmark, R.utils, rmarkdown, rprintf, RSQLite, stringr,\ntestthat (>= 3.0.0), vctrs (>= 0.3.0), waldo (>= 0.3.0), withr"
graphics NA
grDevices "KernSmooth"
grid NA
highr "knitr, markdown, testit"
htmltools "markdown, testthat, withr, Cairo, ragg, shiny"
jquerylib "testthat"
jsonlite "httr, curl, vctrs, testthat, knitr, rmarkdown, R.rsp, sf"
KernSmooth "MASS, carData"
knitr "markdown, formatR, testit, digest, rgl (>= 0.95.1201),\ncodetools, rmarkdown, htmlwidgets (>= 0.7), webshot, tikzDevice\n(>= 0.10), tinytex, reticulate (>= 1.4), JuliaCall (>= 0.11.1),\nmagick, png, jpeg, gifski, xml2 (>= 1.2.0), httr, DBI (>=\n0.4-1), showtext, tibble, sass, bslib, ragg, gridSVG, styler\n(>= 1.2.0), targets (>= 0.6.0)"
lattice "KernSmooth, MASS, latticeExtra"
magrittr "covr, knitr, rlang, rmarkdown, testthat"
markdown "knitr, RCurl"
MASS "lattice, nlme, nnet, survival"
Matrix "expm, MASS"
memoise "digest, aws.s3, covr, googleAuthR, googleCloudStorageR, httr,\ntestthat"
methods "codetools"
mgcv "parallel, survival, MASS"
mime NA
nlme "Hmisc, MASS, SASmixed"
nnet "MASS"
openssl "curl, testthat (>= 2.1.0), digest, knitr, rmarkdown,\njsonlite, jose, sodium"
packrat "testthat (>= 3.0.0), devtools, httr, knitr, rmarkdown"
parallel "methods"
permute "vegan (>= 2.0-0), testthat (>= 0.5), parallel, knitr,\nrmarkdown, bookdown, sessioninfo"
R6 "testthat, pryr"
rappdirs "roxygen2, testthat (>= 3.0.0), covr, withr"
rlang "cli (>= 3.1.0), covr, crayon, fs, glue, knitr, magrittr,\nmethods, pillar, rmarkdown, stats, testthat (>= 3.0.0), tibble,\nusethis, vctrs (>= 0.2.3), withr"
rmarkdown "digest, dygraphs, fs, rsconnect, downlit (>= 0.4.0), katex\n(>= 1.4.0), sass (>= 0.4.0), shiny (>= 1.6.0), testthat (>=\n3.0.3), tibble, tufte, vctrs, withr (>= 2.4.2)"
rpart "survival"
rsconnect "MASS, RCurl, callr, httpuv, knitr, plumber (>= 0.3.2),\nreticulate, rmarkdown (>= 1.1), shiny, sourcetools, testthat,\nxtable"
rstudioapi "testthat, knitr, rmarkdown, clipr, covr"
sass "testthat, knitr, rmarkdown, withr, shiny, curl"
spatial "MASS"
splines "Matrix, methods"
stats "MASS, Matrix, SuppDists, methods, stats4"
stats4 NA
stringi NA
stringr "covr, htmltools, htmlwidgets, knitr, rmarkdown, testthat"
survival NA
sys "unix (>= 1.4), spelling, testthat"
tcltk NA
tinytex "testit, rstudioapi"
tools "codetools, methods, xml2, curl, commonmark, knitr, xfun, mathjaxr"
utils "methods, xml2, commonmark, knitr"
Enhances
askpass NA
base NA
base64enc "png"
boot NA
bslib NA
cachem NA
class NA
cluster NA
codetools NA
compiler NA
curl NA
datasets NA
digest NA
evaluate NA
fastmap NA
foreign NA
fs NA
glue NA
graphics NA
grDevices NA
grid NA
highr NA
htmltools "knitr"
jquerylib NA
jsonlite NA
KernSmooth NA
knitr NA
lattice "chron"
magrittr NA
markdown NA
MASS NA
Matrix "MatrixModels, graph, SparseM, sfsmisc, igraph, maptools, sp,\nspdep"
memoise NA
methods NA
mgcv NA
mime NA
nlme NA
nnet NA
openssl NA
packrat NA
parallel "snow, nws, Rmpi"
permute NA
R6 NA
rappdirs NA
rlang "winch"
rmarkdown NA
rpart NA
rsconnect NA
rstudioapi NA
sass NA
spatial NA
splines NA
stats NA
stats4 NA
stringi NA
stringr NA
survival NA
sys NA
tcltk NA
tinytex NA
tools NA
utils NA
License License_is_FOSS License_restricts_use OS_type
askpass "MIT + file LICENSE" NA NA NA
base "Part of R 4.2.1" NA NA NA
base64enc "GPL-2 | GPL-3" NA NA NA
boot "Unlimited" NA NA NA
bslib "MIT + file LICENSE" NA NA NA
cachem "MIT + file LICENSE" NA NA NA
class "GPL-2 | GPL-3" NA NA NA
cluster "GPL (>= 2)" NA NA NA
codetools "GPL" NA NA NA
compiler "Part of R 4.2.1" NA NA NA
curl "MIT + file LICENSE" NA NA NA
datasets "Part of R 4.2.1" NA NA NA
digest "GPL (>= 2)" NA NA NA
evaluate "MIT + file LICENSE" NA NA NA
fastmap "MIT + file LICENSE" NA NA NA
foreign "GPL (>= 2)" NA NA NA
fs "MIT + file LICENSE" NA NA NA
glue "MIT + file LICENSE" NA NA NA
graphics "Part of R 4.2.1" NA NA NA
grDevices "Part of R 4.2.1" NA NA NA
grid "Part of R 4.2.1" NA NA NA
highr "GPL" NA NA NA
htmltools "GPL (>= 2)" NA NA NA
jquerylib "MIT + file LICENSE" NA NA NA
jsonlite "MIT + file LICENSE" NA NA NA
KernSmooth "Unlimited" NA NA NA
knitr "GPL" NA NA NA
lattice "GPL (>= 2)" NA NA NA
magrittr "MIT + file LICENSE" NA NA NA
markdown "GPL-2" NA NA NA
MASS "GPL-2 | GPL-3" NA NA NA
Matrix "GPL (>= 2) | file LICENCE" NA NA NA
memoise "MIT + file LICENSE" NA NA NA
methods "Part of R 4.2.1" NA NA NA
mgcv "GPL (>= 2)" NA NA NA
mime "GPL" NA NA NA
nlme "GPL (>= 2)" NA NA NA
nnet "GPL-2 | GPL-3" NA NA NA
openssl "MIT + file LICENSE" NA NA NA
packrat "GPL-2" NA NA NA
parallel "Part of R 4.2.1" NA NA NA
permute "GPL-2" NA NA NA
R6 "MIT + file LICENSE" NA NA NA
rappdirs "MIT + file LICENSE" NA NA NA
rlang "MIT + file LICENSE" NA NA NA
rmarkdown "GPL-3" NA NA NA
rpart "GPL-2 | GPL-3" NA NA NA
rsconnect "GPL-2" NA NA NA
rstudioapi "MIT + file LICENSE" NA NA NA
sass "MIT + file LICENSE" NA NA NA
spatial "GPL-2 | GPL-3" NA NA NA
splines "Part of R 4.2.1" NA NA NA
stats "Part of R 4.2.1" NA NA NA
stats4 "Part of R 4.2.1" NA NA NA
stringi "file LICENSE" NA NA NA
stringr "GPL-2 | file LICENSE" NA NA NA
survival "LGPL (>= 2)" NA NA NA
sys "MIT + file LICENSE" NA NA NA
tcltk "Part of R 4.2.1" NA NA NA
tinytex "MIT + file LICENSE" NA NA NA
tools "Part of R 4.2.1" NA NA NA
utils "Part of R 4.2.1" NA NA NA
MD5sum NeedsCompilation Built
askpass NA "yes" "4.2.0"
base NA NA "4.2.1"
base64enc NA "yes" "4.2.0"
boot NA "no" "4.2.1"
bslib NA "no" "4.2.0"
cachem NA "yes" "4.2.0"
class NA "yes" "4.2.1"
cluster NA "yes" "4.2.1"
codetools NA "no" "4.2.1"
compiler NA NA "4.2.1"
curl NA "yes" "4.2.0"
datasets NA NA "4.2.1"
digest NA "yes" "4.2.0"
evaluate NA "no" "4.2.0"
fastmap NA "yes" "4.2.0"
foreign NA "yes" "4.2.1"
fs NA "yes" "4.2.0"
glue NA "yes" "4.2.0"
graphics NA "yes" "4.2.1"
grDevices NA "yes" "4.2.1"
grid NA "yes" "4.2.1"
highr NA "no" "4.2.0"
htmltools NA "yes" "4.2.0"
jquerylib NA "no" "4.2.0"
jsonlite NA "yes" "4.2.0"
KernSmooth NA "yes" "4.2.1"
knitr NA "no" "4.2.0"
lattice NA "yes" "4.2.1"
magrittr NA "yes" "4.2.0"
markdown NA "yes" "4.2.0"
MASS NA "yes" "4.2.1"
Matrix NA "yes" "4.2.1"
memoise NA "no" "4.2.0"
methods NA "yes" "4.2.1"
mgcv NA "yes" "4.2.1"
mime NA "yes" "4.2.0"
nlme NA "yes" "4.2.1"
nnet NA "yes" "4.2.1"
openssl NA "yes" "4.2.0"
packrat NA "no" "4.2.1"
parallel NA "yes" "4.2.1"
permute NA "no" "4.2.0"
R6 NA "no" "4.2.0"
rappdirs NA "yes" "4.2.0"
rlang NA "yes" "4.2.0"
rmarkdown NA "no" "4.2.1"
rpart NA "yes" "4.2.1"
rsconnect NA "no" "4.2.1"
rstudioapi NA "no" "4.2.0"
sass NA "yes" "4.2.0"
spatial NA "yes" "4.2.1"
splines NA "yes" "4.2.1"
stats NA "yes" "4.2.1"
stats4 NA NA "4.2.1"
stringi NA "yes" "4.2.0"
stringr NA "no" "4.2.0"
survival NA "yes" "4.2.1"
sys NA "yes" "4.2.0"
tcltk NA "yes" "4.2.1"
tinytex NA "no" "4.2.0"
tools NA "yes" "4.2.1"
utils NA "yes" "4.2.1"
[ reached getOption("max.print") -- omitted 2 rows ]
#install.packages("vegan", dependencies = TRUE)
#library(vegan)
#remove.packages("vegan")
?plot()
help(plot)
?"<-"
vignette("FAQ-vegan")
Warning: vignette ‘FAQ-vegan’ not found
cats <- data.frame(coat = c("calico", "black", "taffy"),
weight = c(2.1,5,3.2),
likes_string = c(1,0,1))
cats
getwd()
[1] "/Users/josh/Desktop/BIOL PRACTICAL COMPUTING/pratcomp_2022"
write.csv(cats, file = "./cats.csv")
cats <- read.csv("./data/cats/csv")
Warning: cannot open file './data/cats/csv': No such file or directoryError in file(file, "rt") : cannot open the connection
cats$coat
[1] "calico" "black" "taffy"
cats$weight
[1] 2.1 5.0 3.2
cats$weight*10
[1] 21 50 32
log(cats$weight)
[1] 0.7419373 1.6094379 1.1631508
logweight <- log(cats$weight)
cbind(cats,logweight)
cats <- cbind(cats,logweight)
cats
paste("My cat is ", cats$coat, ", and it weighs ", cats$weight, " kg.", sep="")
[1] "My cat is calico, and it weighs 2.1 kg." "My cat is black, and it weighs 5 kg."
[3] "My cat is taffy, and it weighs 3.2 kg."
typeof(cats$coat)
[1] "character"
typeof(cats$weight)
[1] "double"
typeof(cats$likes_string)
[1] "double"
typeof(3.14159)
[1] "double"
typeof(FALSE)
[1] "logical"
typeof(TRUE)
[1] "logical"
typeof(T)
[1] "logical"
typeof(F)
[1] "logical"
typeof(cats)
[1] "list"
class(cats)
[1] "data.frame"
file.show("./data/cats.csv")
Error: File ./data/cats.csv does not exist.
cats$likes_string <- as.logical(cats$likes_string)
cats$likes_string
[1] TRUE FALSE TRUE
c("a","b")
[1] "a" "b"
ab <- c("a", "b")
ab
[1] "a" "b"
c(ab,"c")
[1] "a" "b" "c"
c(ab, ab)
[1] "a" "b" "a" "b"
1:10
[1] 1 2 3 4 5 6 7 8 9 10
seq(10)
[1] 1 2 3 4 5 6 7 8 9 10
z <- seq(10)
head(z, n=3)
[1] 1 2 3
length(z)
[1] 10
class(z)
[1] "integer"
typeof(z)
[1] "integer"
seq(0,100, by=5)
[1] 0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100
cats
str(cats$coat)
chr [1:3] "calico" "black" "taffy"
coats <- c("tabby", "tortoiseshell", "tortoiseshell", "black", "tabby")
coats
[1] "tabby" "tortoiseshell" "tortoiseshell" "black" "tabby"
str(coats)
chr [1:5] "tabby" "tortoiseshell" "tortoiseshell" "black" "tabby"
factor(coats)
[1] tabby tortoiseshell tortoiseshell black tabby
Levels: black tabby tortoiseshell
categories <- factor(coats)
class(coats)
[1] "character"
class(categories)
[1] "factor"
str(categories)
Factor w/ 3 levels "black","tabby",..: 2 3 3 1 2
list_example <- list(title="Numbers", numbers = 1:10, data=TRUE)
list_example
$title
[1] "Numbers"
$numbers
[1] 1 2 3 4 5 6 7 8 9 10
$data
[1] TRUE
another_list <- list(1, "a",TRUE, 1+1i)
another_list
[[1]]
[1] 1
[[2]]
[1] "a"
[[3]]
[1] TRUE
[[4]]
[1] 1+1i
typeof(list_example)
[1] "list"
class(list_example)
[1] "list"
typeof(cats)
[1] "list"
class(cats)
[1] "data.frame"
data.frame(list_example)
cats
cats[,2]
[1] 2.1 5.0 3.2
cats[3,]
cats[2:3,c(1,3)]
matrix_example <- matrix(0, ncol=5, nrow=3)
matrix_example
[,1] [,2] [,3] [,4] [,5]
[1,] 0 0 0 0 0
[2,] 0 0 0 0 0
[3,] 0 0 0 0 0
class(matrix_example)
[1] "matrix" "array"
typeof(matrix_example)
[1] "double"
str(matrix_example)
num [1:3, 1:5] 0 0 0 0 0 0 0 0 0 0 ...
dim(matrix_example)
[1] 3 5
ncol(matrix_example)
[1] 5
nrow(matrix_example)
[1] 3
class(data.frame(matrix_example))
[1] "data.frame"
df_example <- data.frame(matrix_example)
df_example
p <- c(2.3,6.9,4.0,24.3,2)
p
[1] 2.3 6.9 4.0 24.3 2.0
names(p) <- c('a','b','c','d','e')
p
a b c d e
2.3 6.9 4.0 24.3 2.0
p[2:4]
b c d
6.9 4.0 24.3
p[c(1,5)]
a e
2.3 2.0
p[c(1,1,1,3,5,5)]
a a a c e e
2.3 2.3 2.3 4.0 2.0 2.0
p[6]
<NA>
NA
p[-3]
a b d e
2.3 6.9 24.3 2.0
p[c(-1,-5)]
b c d
6.9 4.0 24.3
p[-(2:4)]
a e
2.3 2.0
p[c('a','c')]
a c
2.3 4.0
p[c(T,F,T,F,T)]
a c e
2.3 4.0 2.0
p[names(p) != 'c']
a b d e
2.3 6.9 24.3 2.0
f <- factor(c('a','b','c','d','e'))
f
[1] a b c d e
Levels: a b c d e
f[f == 'a']
[1] a
Levels: a b c d e
f[1:3]
[1] a b c
Levels: a b c d e
f[f %in% c('b','c')]
[1] b c
Levels: a b c d e
f[-3]
[1] a b d e
Levels: a b c d e
f2 <- c('a','a','b','c','c')
f2
[1] "a" "a" "b" "c" "c"
f2[f2 == 'a']
[1] "a" "a"
f2[f2 %in% c('a','c')]
[1] "a" "a" "c" "c"
set.seed(21)
m <- matrix(rnorm(6*4), ncol=4, nrow=6)
m
[,1] [,2] [,3] [,4]
[1,] 0.7930132 -1.570199630 -0.5484056 -0.78464137
[2,] 0.5222513 -0.934905667 0.1725495 -0.42569229
[3,] 1.7462222 0.063493345 0.5628531 0.39299759
[4,] -1.2713361 -0.002393336 1.5118180 0.03675713
[5,] 2.1973895 -2.276781240 0.6590252 -1.03208366
[6,] 0.4331308 0.757412225 1.1220281 -1.26486147
m[3:4, c(3,1)]
[,1] [,2]
[1,] 0.5628531 1.746222
[2,] 1.5118180 -1.271336
m[,c(3,4)]
[,1] [,2]
[1,] -0.5484056 -0.78464137
[2,] 0.1725495 -0.42569229
[3,] 0.5628531 0.39299759
[4,] 1.5118180 0.03675713
[5,] 0.6590252 -1.03208366
[6,] 1.1220281 -1.26486147
xlist <- list(a="BIOL48006220",b=seq(1,10,by = 0.5), data="Grade")
xlist
$a
[1] "BIOL48006220"
$b
[1] 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0
$data
[1] "Grade"
xlist[1:2]
$a
[1] "BIOL48006220"
$b
[1] 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0
xlist['a']
$a
[1] "BIOL48006220"
xlist[['a']]
[1] "BIOL48006220"
xlist['b']
$b
[1] 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0
xlist[['b']]
[1] 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0
xlist$b
[1] 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0
gp <- read.csv('forest_area_sq_km.csv')
head(gp, n=10L)
head(gp[3], n=10L)
nrow(gp)
[1] 214
head(gp[["country"]], 10L)
[1] "Aruba" "Afghanistan" "Angola"
[4] "Albania" "Andorra" "United Arab Emirates"
[7] "Argentina" "Armenia" "American Samoa"
[10] "Antigua and Barbuda"
gp$X2001
[1] "4.2" "12.1k" "766k" "7720" "160" "3110" "327k" "3320" "177" "93.2"
[11] "1.31M" "38.4k" "9960" "1940" "6720" "40.4k" "71.2k" "19.1k" "34.5k" "4"
[21] "5100" "21.1k" "83.4k" "14.5k" "10" "547k" "5.43M" "63" "3940" "26.3k"
[31] "174k" "228k" "3.48M" "8.68" "12k" "160k" "1.82M" "48.7k" "215k" "1.43M"
[41] "222k" "623k" "408" "403" "28.6k" "25.3k" "129" "1720" "26.4k" "114k"
[51] "56" "479" "5750" "19.9k" "16.5k" "136k" "605" "11.1k" "174k" "22.6k"
[61] "184k" "224k" "10.2k" "155k" "0.8" "639" "237k" "34.6" "29.8k" "27.7k"
[71] "86.7k" "0" "68.6k" "3460" "21.3k" "26k" "36.6k" "177" "2.2" "41.1k"
[81] "240" "186k" "67.4k" "18.9k" "3800" "19.5k" "1.01M" "680k" "6480" "96k"
[91] "8190" "328" "1530" "85k" "5280" "975" "249k" "31.4k" "38.9k" "11.9k"
[101] "107k" "11.8" "110" "64.6k" "51.3" "173k" "1380" "81.6k" "2170" "210"
[111] "67" "21.5k" "345" "20.5k" "871" "32.7k" "10" "55.4k" "0" "3500"
[121] "129k" "8.2" "681k" "94" "9580" "133k" "3.5" "342k" "6260" "142k"
[131] "316" "407k" "4110" "412" "30k" "195k" "79.2k" "8380" "13k" "246k"
[141] "51.6k" "3620" "" "121k" "58.2k" "0" "98.5k" "30" "44.3k" "44.2k"
[151] "750k" "72.2k" "398" "363k" "91.1k" "4420" "64.1k" "32.8k" "223k" "91.2"
[161] "1490" "0" "64k" "8.1M" "2830" "9770" "" "87.8k" "172" "25.4k"
[171] "28.9k" "6650" "10" "73.6k" "24.8k" "" "583" "153k" "19k" "12.4k"
[181] "281k" "4760" "" "337" "4440" "105" "61.9k" "12.6k" "192k" "4100"
[191] "41.3k" "9460" "89.5" "2360" "6720" "203k" "10" "529k" "30.8k" "95.2k"
[201] "14.4k" "3.05M" "30.4k" "285" "488k" "36.6" "201" "121k" "4420" "1700"
[211] "5490" "177k" "470k" "183k"
gp[c(1,3), 2:5]
gp[ which(gp$X1989 <= 100 & gp$X2019 >= 100),]
n <- 10
if (n < 10) {
print("n is less than 10")
} else if (n > 10) {
print("n is greater than 10")
} else {
print("n is equal to 10")
}
[1] "n is equal to 10"
for (n in seq(0,20)) {
if (n < 10) {
print("n is less than 10")
} else if (n > 10) {
print("n is greater than 10")
} else {
print("n is equal to 10")
}
}
[1] "n is less than 10"
[1] "n is less than 10"
[1] "n is less than 10"
[1] "n is less than 10"
[1] "n is less than 10"
[1] "n is less than 10"
[1] "n is less than 10"
[1] "n is less than 10"
[1] "n is less than 10"
[1] "n is less than 10"
[1] "n is equal to 10"
[1] "n is greater than 10"
[1] "n is greater than 10"
[1] "n is greater than 10"
[1] "n is greater than 10"
[1] "n is greater than 10"
[1] "n is greater than 10"
[1] "n is greater than 10"
[1] "n is greater than 10"
[1] "n is greater than 10"
[1] "n is greater than 10"
g <- 0
while (g <=10) {
print(paste(g,"is less than or equal to 10"))
g <- g+1
}
[1] "0 is less than or equal to 10"
[1] "1 is less than or equal to 10"
[1] "2 is less than or equal to 10"
[1] "3 is less than or equal to 10"
[1] "4 is less than or equal to 10"
[1] "5 is less than or equal to 10"
[1] "6 is less than or equal to 10"
[1] "7 is less than or equal to 10"
[1] "8 is less than or equal to 10"
[1] "9 is less than or equal to 10"
[1] "10 is less than or equal to 10"
install.packages("ggplot2")
also installing the dependencies ‘cli’, ‘colorspace’, ‘utf8’, ‘farver’, ‘labeling’, ‘lifecycle’, ‘munsell’, ‘RColorBrewer’, ‘viridisLite’, ‘fansi’, ‘pillar’, ‘pkgconfig’, ‘vctrs’, ‘gtable’, ‘isoband’, ‘scales’, ‘tibble’, ‘withr’
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/cli_3.4.1.tgz'
Content type 'application/x-gzip' length 1284000 bytes (1.2 MB)
==================================================
downloaded 1.2 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/colorspace_2.0-3.tgz'
Content type 'application/x-gzip' length 2624460 bytes (2.5 MB)
==================================================
downloaded 2.5 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/utf8_1.2.2.tgz'
Content type 'application/x-gzip' length 196851 bytes (192 KB)
==================================================
downloaded 192 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/farver_2.1.1.tgz'
Content type 'application/x-gzip' length 1943238 bytes (1.9 MB)
==================================================
downloaded 1.9 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/labeling_0.4.2.tgz'
Content type 'application/x-gzip' length 60389 bytes (58 KB)
==================================================
downloaded 58 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/lifecycle_1.0.3.tgz'
Content type 'application/x-gzip' length 121220 bytes (118 KB)
==================================================
downloaded 118 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/munsell_0.5.0.tgz'
Content type 'application/x-gzip' length 241895 bytes (236 KB)
==================================================
downloaded 236 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/RColorBrewer_1.1-3.tgz'
Content type 'application/x-gzip' length 53152 bytes (51 KB)
==================================================
downloaded 51 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/viridisLite_0.4.1.tgz'
Content type 'application/x-gzip' length 1297022 bytes (1.2 MB)
==================================================
downloaded 1.2 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/fansi_1.0.3.tgz'
Content type 'application/x-gzip' length 363921 bytes (355 KB)
==================================================
downloaded 355 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/pillar_1.8.1.tgz'
Content type 'application/x-gzip' length 673948 bytes (658 KB)
==================================================
downloaded 658 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/pkgconfig_2.0.3.tgz'
Content type 'application/x-gzip' length 17870 bytes (17 KB)
==================================================
downloaded 17 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/vctrs_0.4.2.tgz'
Content type 'application/x-gzip' length 1723901 bytes (1.6 MB)
==================================================
downloaded 1.6 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/gtable_0.3.1.tgz'
Content type 'application/x-gzip' length 158928 bytes (155 KB)
==================================================
downloaded 155 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/isoband_0.2.6.tgz'
Content type 'application/x-gzip' length 3386455 bytes (3.2 MB)
==================================================
downloaded 3.2 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/scales_1.2.1.tgz'
Content type 'application/x-gzip' length 608312 bytes (594 KB)
==================================================
downloaded 594 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/tibble_3.1.8.tgz'
Content type 'application/x-gzip' length 720020 bytes (703 KB)
==================================================
downloaded 703 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/withr_2.5.0.tgz'
Content type 'application/x-gzip' length 229317 bytes (223 KB)
==================================================
downloaded 223 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/ggplot2_3.3.6.tgz'
Content type 'application/x-gzip' length 4125157 bytes (3.9 MB)
==================================================
downloaded 3.9 MB
The downloaded binary packages are in
/var/folders/_0/6sf9j_5d6gs3m4rcg_7lqy1r0000gn/T//RtmpZ5guiU/downloaded_packages
library(ggplot2)
forestdata <- read.csv('forest_area_sq_km.csv')
head(forestdata)
ggplot(data=forestdata, mapping=aes(x=X1989, y=X2019)) + geom_point()
gp <- read.csv('gapminder_all.csv')
gp
ggplot(data=gp, mapping=aes(x=gdpPercap_1952, y=pop_1952)) + geom_point()
ggplot(data=gp, mapping=aes(x=gdpPercap_2002, y=pop_2002)) + geom_point()
gapminder <- read.csv("https://raw.githubusercontent.com/swcarpentry/r-novice-gapminder/gh-pages/_episodes_rmd/data/gapminder_data.csv")
head(gapminder)
ggplot(data=gapminder, mapping=aes(x=gdpPercap, y=lifeExp)) + geom_point()
ggplot(data=gapminder, mapping=aes(x=year, y=lifeExp, by=country, color=continent)) + geom_line()
ggplot(data=gapminder, mapping=aes(x=year, y=lifeExp, by=country)) + geom_line(mapping = aes(color=continent)) + geom_point()
ggplot(data=gapminder, mapping=aes(x=gdpPercap, y=lifeExp)) + geom_point()
ggplot(data=gapminder, mapping=aes(x=gdpPercap, y=lifeExp)) + geom_point(alpha=0.25) + scale_x_log10()
ggplot(data=gapminder, mapping=aes(x=gdpPercap, y=lifeExp)) + geom_point(alpha=0.25, color="purple", size = 0.9, pch = 9) + scale_x_log10() + geom_smooth(method=lm, color="gold", size=1.25)
africas <- gapminder[gapminder$continent == "Africa", ]
head(africas)
ggplot(data=africas, mapping = aes(x=year, y=lifeExp)) +
geom_line(color = 'blue') +
facet_wrap( ~ country) +
theme(axis.text.x = element_text(angle = 90)) +
labs(
x = "year",
y = "life Expentency",
title = "Life Expectency Over Time in African Countries"
)
AfricanLifeExp <- ggplot(data=africas, mapping = aes(x=year, y=lifeExp)) +
geom_line(color = 'blue') +
facet_wrap( ~ country) +
theme(axis.text.x = element_text(angle = 90)) +
labs(
x = "year",
y = "life Expentency",
title = "Life Expectency Over Time in African Countries"
)
ggsave(filename = "AfricanLifeExp.png", plot = AfricanLifeExp, width = 24, height = 40, dpi = 300, units = "cm")
pdf(file = "AfricanLifeExp.pdf", width = 24, height = 40)
plot(AfricanLifeExp)
dev.off()
null device
1
write.table(gapminder, file="gapminder_web.csv", sep = ",")
write.csv(africas, file="gapminder_web_africas.csv")
rand <- c(12, 54, 33, 98, 65)
rand
[1] 12 54 33 98 65
sum(rand)
[1] 262
length(rand)
avg.rand <- sum(rand)/length(rand)
avg.rand
[1] 52.4
mean(rand)
[1] 52.4
sort(rand)
[1] 12 33 54 65 98
min(rand)
[1] 12
max(rand)
[1] 98
cumsum(rand)
[1] 12 66 99 197 262
diff(rand)
[1] 42 -21 65 -33
rand[2]
[1] 54
rand*2
[1] 24 108 66 196 130
pedes <- scan()
pedes
beer <- c(3, 4, 1, 1, 3, 4, 3, 3, 1, 3, 2, 1, 2, 1, 2, 3, 2, 3, 1, 1, 1, 1, 4, 3, 1)
length(beer)
[1] 25
barplot(beer)
barplot(table(beer), xlab="Beer", ylab="frequency") # Counts
barplot(table(beer)/length(beer), xlab="Beer", ylab="Proportion") # Proportions instead of frequencies
pie(table(beer), main="Beer preferrence by students")
stem(pedes)
Error in stem(pedes) : object 'pedes' not found
stripchart(pedes, method="stack")
Error in stripchart(pedes, method = "stack") : object 'pedes' not found
##mean(pedes)
mean(gapminder2$lifeExp)
Error in mean(gapminder2$lifeExp) : object 'gapminder2' not found
median(pedes)
median(gapminder$lifeExp)
with(gapminder, median(lifeExp))
which(table(pedes) == max(table(pedes)))
range(pedes)
diff(range(pedes))
var(pedes)
sd(pedes)
C. IQRs
IQR(pedes)
scale(pedes)
summary(pedes)
##hist(pedes, breaks="scott")
##hist(pedes, breaks+"scott", prob=TRUE)
#hist(pedes, breaks="scotts", prob=T)
##plot(density(pedes))
#boxplot(pedes)
#summary(boxplot(pedes))
spid.gen <- read.csv("data/spider_genitalia.csv", header = T)
Warning: cannot open file 'data/spider_genitalia.csv': No such file or directoryError in file(file, "rt") : cannot open the connection
##bxoplot(spid.gen$left.bulb ~ spid.gen$right.bulb)
##plot(spid.gen$left.bulb ~ spid.gen$right.bulb)
plot(spid.gen$left.bulb ~ spid.gen$right.bulb, pch = as.character(spid.gen$habitat))
Error in FUN(X[[i]], ...) : object 'spid.gen' not found
C. Linear regression
gen.reg <- lm(spid.gen$left.bulb ~ spid.gen$right.bulb)
Error in eval(predvars, data, env) : object 'spid.gen' not found
summary(gen.reg)
Error in summary(gen.reg) : object 'gen.reg' not found
###plot(spid.gen$left.bulb ~ spid.gen$right.bulb, pch + as.character(spid.gen$habitat))
##abline(gen.reg)
cor.gen <- with(spid.gen, cor(left.bulb, right.bulb))
Error in with(spid.gen, cor(left.bulb, right.bulb)) :
object 'spid.gen' not found
##spearman.cor.gen <- with(spid.gen, cor(left.bulb, right.bulb, methof"spearman"))
##spearman.cor.gen^2
#####residuals(gen.reg)
#3plot(spid.gen$left.bulb^2~spid.gen$right.bulb)
obs_weighted <- c(4,15,6,15,18,2)
obs_fair <- c(10,10,10,10,10,10)
exp <- c(.16,.17,.16,.17,.17,.17)
chisq.test(obs_weighted, p=exp)
chisq.test(obs_fair, p=exp)
#H0 - true mean is equal to 0, but you can set true mean to other values with mu=
##t.test(spid.gen$carapace.length)
##t.test(spid.gen$carapace.length, mu=29)
#habitat.t2 <- t.test(spid.gen$carapace.length~spid.gen$habitat)
#habitat.t2
#habitat.tless <- t.test(spid.gen$left.bulb, alternative = "less")
#habitat.tless
#habitat.tgreater <- t.test(spid.gen$left.bulb, alternative = "greater")
#habitat.tgreater
plot(1:25, rep(0.25,25), pch=1:25, col=1:25, ylim=c(0,6), cex=2, ylab="Line types (lty) 1 to 6", xlab="Plotting character (pch) 1 to 25 and colours (col) 1 to 8", main="Line types (lty), plotting characters (pch), \nand colors (col) for plot and xyplot", lab=c(25,7,2))
points(1:8, rep(0.5,8), pch=20, col=1:8, cex=4)
abline(h=1:6, lty=1:6, col=1:6, lwd=3)
pdf("./DATA/PlotCheatSheet.pdf")
Error in pdf("./DATA/PlotCheatSheet.pdf") :
cannot open file './DATA/PlotCheatSheet.pdf'
x <- 0
if(x > 0){
print("positive number")
} else if (x < 0) {
print("negativce number")
} else
print("zero")
[1] "zero"
a <- c(5,7,2,9)
ifelse(a %% 2 == 0, "even", "odd")
[1] "odd" "odd" "even" "odd"
z <- c(2,5,3,7,8,9,11,7)
count <- 0
for (val in z) {
if(val %% 2 == 0) count = count+1
}
print(count)
[1] 2
i <- 1
while (i < 5) {
print(i)
i = i+1
}
[1] 1
[1] 2
[1] 3
[1] 4
x <- 1:5
for (val in x) {
if (val == 3) {
break
}
print(val)
}
[1] 1
[1] 2
x <- 1:5
for (val in x) {
if (val == 3) {
next
}
print(val)
}
[1] 1
[1] 2
[1] 4
[1] 5
x <- 1:5
repeat {
print(x)
x = x+1
}
[1] 1 2 3 4 5
[1] 2 3 4 5 6
[1] 3 4 5 6 7
[1] 4 5 6 7 8
[1] 5 6 7 8 9
[1] 6 7 8 9 10
[1] 7 8 9 10 11
[1] 8 9 10 11 12
[1] 9 10 11 12 13
[1] 10 11 12 13 14
[1] 11 12 13 14 15
[1] 12 13 14 15 16
[1] 13 14 15 16 17
[1] 14 15 16 17 18
[1] 15 16 17 18 19
[1] 16 17 18 19 20
[1] 17 18 19 20 21
[1] 18 19 20 21 22
[1] 19 20 21 22 23
[1] 20 21 22 23 24
[1] 21 22 23 24 25
[1] 22 23 24 25 26
[1] 23 24 25 26 27
[1] 24 25 26 27 28
[1] 25 26 27 28 29
[1] 26 27 28 29 30
[1] 27 28 29 30 31
[1] 28 29 30 31 32
[1] 29 30 31 32 33
[1] 30 31 32 33 34
[1] 31 32 33 34 35
[1] 32 33 34 35 36
[1] 33 34 35 36 37
[1] 34 35 36 37 38
[1] 35 36 37 38 39
[1] 36 37 38 39 40
[1] 37 38 39 40 41
[1] 38 39 40 41 42
[1] 39 40 41 42 43
[1] 40 41 42 43 44
[1] 41 42 43 44 45
[1] 42 43 44 45 46
[1] 43 44 45 46 47
[1] 44 45 46 47 48
[1] 45 46 47 48 49
[1] 46 47 48 49 50
[1] 47 48 49 50 51
[1] 48 49 50 51 52
[1] 49 50 51 52 53
[1] 50 51 52 53 54
[1] 51 52 53 54 55
[1] 52 53 54 55 56
[1] 53 54 55 56 57
[1] 54 55 56 57 58
[1] 55 56 57 58 59
[1] 56 57 58 59 60
[1] 57 58 59 60 61
[1] 58 59 60 61 62
[1] 59 60 61 62 63
[1] 60 61 62 63 64
[1] 61 62 63 64 65
[1] 62 63 64 65 66
[1] 63 64 65 66 67
[1] 64 65 66 67 68
[1] 65 66 67 68 69
[1] 66 67 68 69 70
[1] 67 68 69 70 71
[1] 68 69 70 71 72
[1] 69 70 71 72 73
[1] 70 71 72 73 74
[1] 71 72 73 74 75
[1] 72 73 74 75 76
[1] 73 74 75 76 77
[1] 74 75 76 77 78
[1] 75 76 77 78 79
[1] 76 77 78 79 80
[1] 77 78 79 80 81
[1] 78 79 80 81 82
[1] 79 80 81 82 83
[1] 80 81 82 83 84
[1] 81 82 83 84 85
[1] 82 83 84 85 86
[1] 83 84 85 86 87
[1] 84 85 86 87 88
[1] 85 86 87 88 89
[1] 86 87 88 89 90
[1] 87 88 89 90 91
[1] 88 89 90 91 92
[1] 89 90 91 92 93
[1] 90 91 92 93 94
[1] 91 92 93 94 95
[1] 92 93 94 95 96
[1] 93 94 95 96 97
[1] 94 95 96 97 98
[1] 95 96 97 98 99
[1] 96 97 98 99 100
[1] 97 98 99 100 101
[1] 98 99 100 101 102
[1] 99 100 101 102 103
[1] 100 101 102 103 104
[1] 101 102 103 104 105
[1] 102 103 104 105 106
[1] 103 104 105 106 107
[1] 104 105 106 107 108
[1] 105 106 107 108 109
[1] 106 107 108 109 110
[1] 107 108 109 110 111
[1] 108 109 110 111 112
[1] 109 110 111 112 113
[1] 110 111 112 113 114
[1] 111 112 113 114 115
[1] 112 113 114 115 116
[1] 113 114 115 116 117
[1] 114 115 116 117 118
[1] 115 116 117 118 119
[1] 116 117 118 119 120
[1] 117 118 119 120 121
[1] 118 119 120 121 122
[1] 119 120 121 122 123
[1] 120 121 122 123 124
[1] 121 122 123 124 125
[1] 122 123 124 125 126
[1] 123 124 125 126 127
[1] 124 125 126 127 128
[1] 125 126 127 128 129
[1] 126 127 128 129 130
[1] 127 128 129 130 131
[1] 128 129 130 131 132
[1] 129 130 131 132 133
[1] 130 131 132 133 134
[1] 131 132 133 134 135
[1] 132 133 134 135 136
[1] 133 134 135 136 137
[1] 134 135 136 137 138
[1] 135 136 137 138 139
[1] 136 137 138 139 140
[1] 137 138 139 140 141
[1] 138 139 140 141 142
[1] 139 140 141 142 143
[1] 140 141 142 143 144
[1] 141 142 143 144 145
[1] 142 143 144 145 146
[1] 143 144 145 146 147
[1] 144 145 146 147 148
[1] 145 146 147 148 149
[1] 146 147 148 149 150
[1] 147 148 149 150 151
[1] 148 149 150 151 152
[1] 149 150 151 152 153
[1] 150 151 152 153 154
[1] 151 152 153 154 155
[1] 152 153 154 155 156
[1] 153 154 155 156 157
[1] 154 155 156 157 158
[1] 155 156 157 158 159
[1] 156 157 158 159 160
[1] 157 158 159 160 161
[1] 158 159 160 161 162
[1] 159 160 161 162 163
[1] 160 161 162 163 164
[1] 161 162 163 164 165
[1] 162 163 164 165 166
[1] 163 164 165 166 167
[1] 164 165 166 167 168
[1] 165 166 167 168 169
[1] 166 167 168 169 170
[1] 167 168 169 170 171
[1] 168 169 170 171 172
[1] 169 170 171 172 173
[1] 170 171 172 173 174
[1] 171 172 173 174 175
[1] 172 173 174 175 176
[1] 173 174 175 176 177
[1] 174 175 176 177 178
[1] 175 176 177 178 179
[1] 176 177 178 179 180
[1] 177 178 179 180 181
[1] 178 179 180 181 182
[1] 179 180 181 182 183
[1] 180 181 182 183 184
[1] 181 182 183 184 185
[1] 182 183 184 185 186
[1] 183 184 185 186 187
[1] 184 185 186 187 188
[1] 185 186 187 188 189
[1] 186 187 188 189 190
[1] 187 188 189 190 191
[1] 188 189 190 191 192
[1] 189 190 191 192 193
[1] 190 191 192 193 194
[1] 191 192 193 194 195
[1] 192 193 194 195 196
[1] 193 194 195 196 197
[1] 194 195 196 197 198
[1] 195 196 197 198 199
[1] 196 197 198 199 200
[1] 197 198 199 200 201
[1] 198 199 200 201 202
[1] 199 200 201 202 203
[1] 200 201 202 203 204
[1] 201 202 203 204 205
[1] 202 203 204 205 206
[1] 203 204 205 206 207
[1] 204 205 206 207 208
[1] 205 206 207 208 209
[1] 206 207 208 209 210
[1] 207 208 209 210 211
[1] 208 209 210 211 212
[1] 209 210 211 212 213
[1] 210 211 212 213 214
[1] 211 212 213 214 215
[1] 212 213 214 215 216
[1] 213 214 215 216 217
[1] 214 215 216 217 218
[1] 215 216 217 218 219
[1] 216 217 218 219 220
[1] 217 218 219 220 221
[1] 218 219 220 221 222
[1] 219 220 221 222 223
[1] 220 221 222 223 224
[1] 221 222 223 224 225
[1] 222 223 224 225 226
[1] 223 224 225 226 227
[1] 224 225 226 227 228
[1] 225 226 227 228 229
[1] 226 227 228 229 230
[1] 227 228 229 230 231
[1] 228 229 230 231 232
[1] 229 230 231 232 233
[1] 230 231 232 233 234
[1] 231 232 233 234 235
[1] 232 233 234 235 236
[1] 233 234 235 236 237
[1] 234 235 236 237 238
[1] 235 236 237 238 239
[1] 236 237 238 239 240
[1] 237 238 239 240 241
[1] 238 239 240 241 242
[1] 239 240 241 242 243
[1] 240 241 242 243 244
[1] 241 242 243 244 245
[1] 242 243 244 245 246
[1] 243 244 245 246 247
[1] 244 245 246 247 248
[1] 245 246 247 248 249
[1] 246 247 248 249 250
[1] 247 248 249 250 251
[1] 248 249 250 251 252
[1] 249 250 251 252 253
[1] 250 251 252 253 254
[1] 251 252 253 254 255
[1] 252 253 254 255 256
[1] 253 254 255 256 257
[1] 254 255 256 257 258
[1] 255 256 257 258 259
[1] 256 257 258 259 260
[1] 257 258 259 260 261
[1] 258 259 260 261 262
[1] 259 260 261 262 263
[1] 260 261 262 263 264
[1] 261 262 263 264 265
[1] 262 263 264 265 266
[1] 263 264 265 266 267
[1] 264 265 266 267 268
[1] 265 266 267 268 269
[1] 266 267 268 269 270
[1] 267 268 269 270 271
[1] 268 269 270 271 272
[1] 269 270 271 272 273
[1] 270 271 272 273 274
[1] 271 272 273 274 275
[1] 272 273 274 275 276
[1] 273 274 275 276 277
[1] 274 275 276 277 278
[1] 275 276 277 278 279
[1] 276 277 278 279 280
[1] 277 278 279 280 281
[1] 278 279 280 281 282
[1] 279 280 281 282 283
[1] 280 281 282 283 284
[1] 281 282 283 284 285
[1] 282 283 284 285 286
[1] 283 284 285 286 287
[1] 284 285 286 287 288
[1] 285 286 287 288 289
[1] 286 287 288 289 290
[1] 287 288 289 290 291
[1] 288 289 290 291 292
[1] 289 290 291 292 293
[1] 290 291 292 293 294
[1] 291 292 293 294 295
[1] 292 293 294 295 296
[1] 293 294 295 296 297
[1] 294 295 296 297 298
[1] 295 296 297 298 299
[1] 296 297 298 299 300
[1] 297 298 299 300 301
[1] 298 299 300 301 302
[1] 299 300 301 302 303
[1] 300 301 302 303 304
[1] 301 302 303 304 305
[1] 302 303 304 305 306
[1] 303 304 305 306 307
[1] 304 305 306 307 308
[1] 305 306 307 308 309
[1] 306 307 308 309 310
[1] 307 308 309 310 311
[1] 308 309 310 311 312
[1] 309 310 311 312 313
[1] 310 311 312 313 314
[1] 311 312 313 314 315
[1] 312 313 314 315 316
[1] 313 314 315 316 317
[1] 314 315 316 317 318
[1] 315 316 317 318 319
[1] 316 317 318 319 320
[1] 317 318 319 320 321
[1] 318 319 320 321 322
[1] 319 320 321 322 323
[1] 320 321 322 323 324
[1] 321 322 323 324 325
[1] 322 323 324 325 326
[1] 323 324 325 326 327
[1] 324 325 326 327 328
[1] 325 326 327 328 329
[1] 326 327 328 329 330
[1] 327 328 329 330 331
[1] 328 329 330 331 332
[1] 329 330 331 332 333
[1] 330 331 332 333 334
[1] 331 332 333 334 335
[1] 332 333 334 335 336
[1] 333 334 335 336 337
[1] 334 335 336 337 338
[1] 335 336 337 338 339
[1] 336 337 338 339 340
[1] 337 338 339 340 341
[1] 338 339 340 341 342
[1] 339 340 341 342 343
[1] 340 341 342 343 344
[1] 341 342 343 344 345
[1] 342 343 344 345 346
[1] 343 344 345 346 347
[1] 344 345 346 347 348
[1] 345 346 347 348 349
[1] 346 347 348 349 350
[1] 347 348 349 350 351
[1] 348 349 350 351 352
[1] 349 350 351 352 353
[1] 350 351 352 353 354
[1] 351 352 353 354 355
[1] 352 353 354 355 356
[1] 353 354 355 356 357
[1] 354 355 356 357 358
[1] 355 356 357 358 359
[1] 356 357 358 359 360
[1] 357 358 359 360 361
[1] 358 359 360 361 362
[1] 359 360 361 362 363
[1] 360 361 362 363 364
[1] 361 362 363 364 365
[1] 362 363 364 365 366
[1] 363 364 365 366 367
[1] 364 365 366 367 368
[1] 365 366 367 368 369
[1] 366 367 368 369 370
[1] 367 368 369 370 371
[1] 368 369 370 371 372
[1] 369 370 371 372 373
[1] 370 371 372 373 374
[1] 371 372 373 374 375
[1] 372 373 374 375 376
[1] 373 374 375 376 377
[1] 374 375 376 377 378
[1] 375 376 377 378 379
[1] 376 377 378 379 380
[1] 377 378 379 380 381
[1] 378 379 380 381 382
[1] 379 380 381 382 383
[1] 380 381 382 383 384
[1] 381 382 383 384 385
[1] 382 383 384 385 386
[1] 383 384 385 386 387
[1] 384 385 386 387 388
[1] 385 386 387 388 389
[1] 386 387 388 389 390
[1] 387 388 389 390 391
[1] 388 389 390 391 392
[1] 389 390 391 392 393
[1] 390 391 392 393 394
[1] 391 392 393 394 395
[1] 392 393 394 395 396
[1] 393 394 395 396 397
[1] 394 395 396 397 398
[1] 395 396 397 398 399
[1] 396 397 398 399 400
[1] 397 398 399 400 401
[1] 398 399 400 401 402
[1] 399 400 401 402 403
[1] 400 401 402 403 404
[1] 401 402 403 404 405
[1] 402 403 404 405 406
[1] 403 404 405 406 407
[1] 404 405 406 407 408
[1] 405 406 407 408 409
[1] 406 407 408 409 410
[1] 407 408 409 410 411
[1] 408 409 410 411 412
[1] 409 410 411 412 413
[1] 410 411 412 413 414
[1] 411 412 413 414 415
[1] 412 413 414 415 416
[1] 413 414 415 416 417
[1] 414 415 416 417 418
[1] 415 416 417 418 419
[1] 416 417 418 419 420
[1] 417 418 419 420 421
[1] 418 419 420 421 422
[1] 419 420 421 422 423
[1] 420 421 422 423 424
[1] 421 422 423 424 425
[1] 422 423 424 425 426
[1] 423 424 425 426 427
[1] 424 425 426 427 428
[1] 425 426 427 428 429
[1] 426 427 428 429 430
[1] 427 428 429 430 431
[1] 428 429 430 431 432
[1] 429 430 431 432 433
[1] 430 431 432 433 434
[1] 431 432 433 434 435
[1] 432 433 434 435 436
[1] 433 434 435 436 437
[1] 434 435 436 437 438
[1] 435 436 437 438 439
[1] 436 437 438 439 440
[1] 437 438 439 440 441
[1] 438 439 440 441 442
[1] 439 440 441 442 443
[1] 440 441 442 443 444
[1] 441 442 443 444 445
[1] 442 443 444 445 446
[1] 443 444 445 446 447
[1] 444 445 446 447 448
[1] 445 446 447 448 449
[1] 446 447 448 449 450
[1] 447 448 449 450 451
[1] 448 449 450 451 452
[1] 449 450 451 452 453
[1] 450 451 452 453 454
[1] 451 452 453 454 455
[1] 452 453 454 455 456
[1] 453 454 455 456 457
[1] 454 455 456 457 458
[1] 455 456 457 458 459
[1] 456 457 458 459 460
[1] 457 458 459 460 461
[1] 458 459 460 461 462
[1] 459 460 461 462 463
[1] 460 461 462 463 464
[1] 461 462 463 464 465
[1] 462 463 464 465 466
[1] 463 464 465 466 467
[1] 464 465 466 467 468
[1] 465 466 467 468 469
[1] 466 467 468 469 470
[1] 467 468 469 470 471
[1] 468 469 470 471 472
[1] 469 470 471 472 473
[1] 470 471 472 473 474
[1] 471 472 473 474 475
[1] 472 473 474 475 476
[1] 473 474 475 476 477
[1] 474 475 476 477 478
[1] 475 476 477 478 479
[1] 476 477 478 479 480
[1] 477 478 479 480 481
[1] 478 479 480 481 482
[1] 479 480 481 482 483
[1] 480 481 482 483 484
[1] 481 482 483 484 485
[1] 482 483 484 485 486
[1] 483 484 485 486 487
[1] 484 485 486 487 488
[1] 485 486 487 488 489
[1] 486 487 488 489 490
[1] 487 488 489 490 491
[1] 488 489 490 491 492
[1] 489 490 491 492 493
[1] 490 491 492 493 494
[1] 491 492 493 494 495
[1] 492 493 494 495 496
[1] 493 494 495 496 497
[1] 494 495 496 497 498
[1] 495 496 497 498 499
[1] 496 497 498 499 500
[1] 497 498 499 500 501
[1] 498 499 500 501 502
[1] 499 500 501 502 503
[1] 500 501 502 503 504
[1] 501 502 503 504 505
[1] 502 503 504 505 506
[1] 503 504 505 506 507
[1] 504 505 506 507 508
[1] 505 506 507 508 509
[1] 506 507 508 509 510
[1] 507 508 509 510 511
[1] 508 509 510 511 512
[1] 509 510 511 512 513
[1] 510 511 512 513 514
[1] 511 512 513 514 515
[1] 512 513 514 515 516
[1] 513 514 515 516 517
[1] 514 515 516 517 518
[1] 515 516 517 518 519
[1] 516 517 518 519 520
[1] 517 518 519 520 521
[1] 518 519 520 521 522
[1] 519 520 521 522 523
[1] 520 521 522 523 524
[1] 521 522 523 524 525
[1] 522 523 524 525 526
[1] 523 524 525 526 527
[1] 524 525 526 527 528
[1] 525 526 527 528 529
[1] 526 527 528 529 530
[1] 527 528 529 530 531
[1] 528 529 530 531 532
[1] 529 530 531 532 533
[1] 530 531 532 533 534
[1] 531 532 533 534 535
[1] 532 533 534 535 536
[1] 533 534 535 536 537
[1] 534 535 536 537 538
[1] 535 536 537 538 539
[1] 536 537 538 539 540
[1] 537 538 539 540 541
[1] 538 539 540 541 542
[1] 539 540 541 542 543
[1] 540 541 542 543 544
[1] 541 542 543 544 545
[1] 542 543 544 545 546
[1] 543 544 545 546 547
[1] 544 545 546 547 548
[1] 545 546 547 548 549
[1] 546 547 548 549 550
[1] 547 548 549 550 551
[1] 548 549 550 551 552
[1] 549 550 551 552 553
[1] 550 551 552 553 554
[1] 551 552 553 554 555
[1] 552 553 554 555 556
[1] 553 554 555 556 557
[1] 554 555 556 557 558
[1] 555 556 557 558 559
[1] 556 557 558 559 560
[1] 557 558 559 560 561
[1] 558 559 560 561 562
[1] 559 560 561 562 563
[1] 560 561 562 563 564
[1] 561 562 563 564 565
[1] 562 563 564 565 566
[1] 563 564 565 566 567
[1] 564 565 566 567 568
[1] 565 566 567 568 569
[1] 566 567 568 569 570
[1] 567 568 569 570 571
[1] 568 569 570 571 572
[1] 569 570 571 572 573
[1] 570 571 572 573 574
[1] 571 572 573 574 575
[1] 572 573 574 575 576
[1] 573 574 575 576 577
[1] 574 575 576 577 578
[1] 575 576 577 578 579
[1] 576 577 578 579 580
[1] 577 578 579 580 581
[1] 578 579 580 581 582
[1] 579 580 581 582 583
[1] 580 581 582 583 584
[1] 581 582 583 584 585
[1] 582 583 584 585 586
[1] 583 584 585 586 587
[1] 584 585 586 587 588
[1] 585 586 587 588 589
[1] 586 587 588 589 590
[1] 587 588 589 590 591
[1] 588 589 590 591 592
[1] 589 590 591 592 593
[1] 590 591 592 593 594
[1] 591 592 593 594 595
[1] 592 593 594 595 596
[1] 593 594 595 596 597
[1] 594 595 596 597 598
[1] 595 596 597 598 599
[1] 596 597 598 599 600
[1] 597 598 599 600 601
[1] 598 599 600 601 602
[1] 599 600 601 602 603
[1] 600 601 602 603 604
[1] 601 602 603 604 605
[1] 602 603 604 605 606
[1] 603 604 605 606 607
[1] 604 605 606 607 608
[1] 605 606 607 608 609
[1] 606 607 608 609 610
[1] 607 608 609 610 611
[1] 608 609 610 611 612
[1] 609 610 611 612 613
[1] 610 611 612 613 614
[1] 611 612 613 614 615
[1] 612 613 614 615 616
[1] 613 614 615 616 617
[1] 614 615 616 617 618
[1] 615 616 617 618 619
[1] 616 617 618 619 620
[1] 617 618 619 620 621
[1] 618 619 620 621 622
[1] 619 620 621 622 623
[1] 620 621 622 623 624
[1] 621 622 623 624 625
[1] 622 623 624 625 626
[1] 623 624 625 626 627
[1] 624 625 626 627 628
[1] 625 626 627 628 629
[1] 626 627 628 629 630
[1] 627 628 629 630 631
[1] 628 629 630 631 632
[1] 629 630 631 632 633
[1] 630 631 632 633 634
[1] 631 632 633 634 635
[1] 632 633 634 635 636
[1] 633 634 635 636 637
[1] 634 635 636 637 638
[1] 635 636 637 638 639
[1] 636 637 638 639 640
[1] 637 638 639 640 641
[1] 638 639 640 641 642
[1] 639 640 641 642 643
[1] 640 641 642 643 644
[1] 641 642 643 644 645
[1] 642 643 644 645 646
[1] 643 644 645 646 647
[1] 644 645 646 647 648
[1] 645 646 647 648 649
[1] 646 647 648 649 650
[1] 647 648 649 650 651
[1] 648 649 650 651 652
[1] 649 650 651 652 653
[1] 650 651 652 653 654
[1] 651 652 653 654 655
[1] 652 653 654 655 656
[1] 653 654 655 656 657
[1] 654 655 656 657 658
[1] 655 656 657 658 659
[1] 656 657 658 659 660
[1] 657 658 659 660 661
[1] 658 659 660 661 662
[1] 659 660 661 662 663
[1] 660 661 662 663 664
[1] 661 662 663 664 665
[1] 662 663 664 665 666
[1] 663 664 665 666 667
[1] 664 665 666 667 668
[1] 665 666 667 668 669
[1] 666 667 668 669 670
[1] 667 668 669 670 671
[1] 668 669 670 671 672
[1] 669 670 671 672 673
[1] 670 671 672 673 674
[1] 671 672 673 674 675
[1] 672 673 674 675 676
[1] 673 674 675 676 677
[1] 674 675 676 677 678
[1] 675 676 677 678 679
[1] 676 677 678 679 680
[1] 677 678 679 680 681
[1] 678 679 680 681 682
[1] 679 680 681 682 683
[1] 680 681 682 683 684
[1] 681 682 683 684 685
[1] 682 683 684 685 686
[1] 683 684 685 686 687
[1] 684 685 686 687 688
[1] 685 686 687 688 689
[1] 686 687 688 689 690
[1] 687 688 689 690 691
[1] 688 689 690 691 692
[1] 689 690 691 692 693
[1] 690 691 692 693 694
[1] 691 692 693 694 695
[1] 692 693 694 695 696
[1] 693 694 695 696 697
[1] 694 695 696 697 698
[1] 695 696 697 698 699
[1] 696 697 698 699 700
[1] 697 698 699 700 701
[1] 698 699 700 701 702
[1] 699 700 701 702 703
[1] 700 701 702 703 704
[1] 701 702 703 704 705
[1] 702 703 704 705 706
[1] 703 704 705 706 707
[1] 704 705 706 707 708
[1] 705 706 707 708 709
[1] 706 707 708 709 710
[1] 707 708 709 710 711
[1] 708 709 710 711 712
[1] 709 710 711 712 713
[1] 710 711 712 713 714
[1] 711 712 713 714 715
[1] 712 713 714 715 716
[1] 713 714 715 716 717
[1] 714 715 716 717 718
[1] 715 716 717 718 719
[1] 716 717 718 719 720
[1] 717 718 719 720 721
[1] 718 719 720 721 722
[1] 719 720 721 722 723
[1] 720 721 722 723 724
[1] 721 722 723 724 725
[1] 722 723 724 725 726
[1] 723 724 725 726 727
[1] 724 725 726 727 728
[1] 725 726 727 728 729
[1] 726 727 728 729 730
[1] 727 728 729 730 731
[1] 728 729 730 731 732
[1] 729 730 731 732 733
[1] 730 731 732 733 734
[1] 731 732 733 734 735
[1] 732 733 734 735 736
[1] 733 734 735 736 737
[1] 734 735 736 737 738
[1] 735 736 737 738 739
[1] 736 737 738 739 740
[1] 737 738 739 740 741
[1] 738 739 740 741 742
[1] 739 740 741 742 743
[1] 740 741 742 743 744
[1] 741 742 743 744 745
[1] 742 743 744 745 746
[1] 743 744 745 746 747
[1] 744 745 746 747 748
[1] 745 746 747 748 749
[1] 746 747 748 749 750
[1] 747 748 749 750 751
[1] 748 749 750 751 752
[1] 749 750 751 752 753
[1] 750 751 752 753 754
[1] 751 752 753 754 755
[1] 752 753 754 755 756
[1] 753 754 755 756 757
[1] 754 755 756 757 758
[1] 755 756 757 758 759
[1] 756 757 758 759 760
[1] 757 758 759 760 761
[1] 758 759 760 761 762
[1] 759 760 761 762 763
[1] 760 761 762 763 764
[1] 761 762 763 764 765
[1] 762 763 764 765 766
[1] 763 764 765 766 767
[1] 764 765 766 767 768
[1] 765 766 767 768 769
[1] 766 767 768 769 770
[1] 767 768 769 770 771
[1] 768 769 770 771 772
[1] 769 770 771 772 773
[1] 770 771 772 773 774
[1] 771 772 773 774 775
[1] 772 773 774 775 776
[1] 773 774 775 776 777
[1] 774 775 776 777 778
[1] 775 776 777 778 779
[1] 776 777 778 779 780
[1] 777 778 779 780 781
[1] 778 779 780 781 782
[1] 779 780 781 782 783
[1] 780 781 782 783 784
[1] 781 782 783 784 785
[1] 782 783 784 785 786
[1] 783 784 785 786 787
[1] 784 785 786 787 788
[1] 785 786 787 788 789
[1] 786 787 788 789 790
[1] 787 788 789 790 791
[1] 788 789 790 791 792
[1] 789 790 791 792 793
[1] 790 791 792 793 794
[1] 791 792 793 794 795
[1] 792 793 794 795 796
[1] 793 794 795 796 797
[1] 794 795 796 797 798
[1] 795 796 797 798 799
[1] 796 797 798 799 800
[1] 797 798 799 800 801
[1] 798 799 800 801 802
[1] 799 800 801 802 803
[1] 800 801 802 803 804
[1] 801 802 803 804 805
[1] 802 803 804 805 806
[1] 803 804 805 806 807
[1] 804 805 806 807 808
[1] 805 806 807 808 809
[1] 806 807 808 809 810
[1] 807 808 809 810 811
[1] 808 809 810 811 812
[1] 809 810 811 812 813
[1] 810 811 812 813 814
[1] 811 812 813 814 815
[1] 812 813 814 815 816
[1] 813 814 815 816 817
[1] 814 815 816 817 818
[1] 815 816 817 818 819
[1] 816 817 818 819 820
[1] 817 818 819 820 821
[1] 818 819 820 821 822
[1] 819 820 821 822 823
[1] 820 821 822 823 824
[1] 821 822 823 824 825
[1] 822 823 824 825 826
[1] 823 824 825 826 827
[1] 824 825 826 827 828
[1] 825 826 827 828 829
[1] 826 827 828 829 830
[1] 827 828 829 830 831
[1] 828 829 830 831 832
[1] 829 830 831 832 833
[1] 830 831 832 833 834
[1] 831 832 833 834 835
[1] 832 833 834 835 836
[1] 833 834 835 836 837
[1] 834 835 836 837 838
[1] 835 836 837 838 839
[1] 836 837 838 839 840
[1] 837 838 839 840 841
[1] 838 839 840 841 842
[1] 839 840 841 842 843
[1] 840 841 842 843 844
[1] 841 842 843 844 845
[1] 842 843 844 845 846
[1] 843 844 845 846 847
[1] 844 845 846 847 848
[1] 845 846 847 848 849
[1] 846 847 848 849 850
[1] 847 848 849 850 851
[1] 848 849 850 851 852
[1] 849 850 851 852 853
[1] 850 851 852 853 854
[1] 851 852 853 854 855
[1] 852 853 854 855 856
[1] 853 854 855 856 857
[1] 854 855 856 857 858
[1] 855 856 857 858 859
[1] 856 857 858 859 860
[1] 857 858 859 860 861
[1] 858 859 860 861 862
[1] 859 860 861 862 863
[1] 860 861 862 863 864
[1] 861 862 863 864 865
[1] 862 863 864 865 866
[1] 863 864 865 866 867
[1] 864 865 866 867 868
[1] 865 866 867 868 869
[1] 866 867 868 869 870
[1] 867 868 869 870 871
[1] 868 869 870 871 872
[1] 869 870 871 872 873
[1] 870 871 872 873 874
[1] 871 872 873 874 875
[1] 872 873 874 875 876
[1] 873 874 875 876 877
[1] 874 875 876 877 878
[1] 875 876 877 878 879
[1] 876 877 878 879 880
[1] 877 878 879 880 881
[1] 878 879 880 881 882
[1] 879 880 881 882 883
[1] 880 881 882 883 884
[1] 881 882 883 884 885
[1] 882 883 884 885 886
[1] 883 884 885 886 887
[1] 884 885 886 887 888
[1] 885 886 887 888 889
[1] 886 887 888 889 890
[1] 887 888 889 890 891
[1] 888 889 890 891 892
[1] 889 890 891 892 893
[1] 890 891 892 893 894
[1] 891 892 893 894 895
[1] 892 893 894 895 896
[1] 893 894 895 896 897
[1] 894 895 896 897 898
[1] 895 896 897 898 899
[1] 896 897 898 899 900
[1] 897 898 899 900 901
[1] 898 899 900 901 902
[1] 899 900 901 902 903
[1] 900 901 902 903 904
[1] 901 902 903 904 905
[1] 902 903 904 905 906
[1] 903 904 905 906 907
[1] 904 905 906 907 908
[1] 905 906 907 908 909
[1] 906 907 908 909 910
[1] 907 908 909 910 911
[1] 908 909 910 911 912
[1] 909 910 911 912 913
[1] 910 911 912 913 914
[1] 911 912 913 914 915
[1] 912 913 914 915 916
[1] 913 914 915 916 917
[1] 914 915 916 917 918
[1] 915 916 917 918 919
[1] 916 917 918 919 920
[1] 917 918 919 920 921
[1] 918 919 920 921 922
[1] 919 920 921 922 923
[1] 920 921 922 923 924
[1] 921 922 923 924 925
[1] 922 923 924 925 926
[1] 923 924 925 926 927
[1] 924 925 926 927 928
[1] 925 926 927 928 929
[1] 926 927 928 929 930
[1] 927 928 929 930 931
[1] 928 929 930 931 932
[1] 929 930 931 932 933
[1] 930 931 932 933 934
[1] 931 932 933 934 935
[1] 932 933 934 935 936
[1] 933 934 935 936 937
[1] 934 935 936 937 938
[1] 935 936 937 938 939
[1] 936 937 938 939 940
[1] 937 938 939 940 941
[1] 938 939 940 941 942
[1] 939 940 941 942 943
[1] 940 941 942 943 944
[1] 941 942 943 944 945
[1] 942 943 944 945 946
[1] 943 944 945 946 947
[1] 944 945 946 947 948
[1] 945 946 947 948 949
[1] 946 947 948 949 950
[1] 947 948 949 950 951
[1] 948 949 950 951 952
[1] 949 950 951 952 953
[1] 950 951 952 953 954
[1] 951 952 953 954 955
[1] 952 953 954 955 956
[1] 953 954 955 956 957
[1] 954 955 956 957 958
[1] 955 956 957 958 959
[1] 956 957 958 959 960
[1] 957 958 959 960 961
[1] 958 959 960 961 962
[1] 959 960 961 962 963
[1] 960 961 962 963 964
[1] 961 962 963 964 965
[1] 962 963 964 965 966
[1] 963 964 965 966 967
[1] 964 965 966 967 968
[1] 965 966 967 968 969
[1] 966 967 968 969 970
[1] 967 968 969 970 971
[1] 968 969 970 971 972
[1] 969 970 971 972 973
[1] 970 971 972 973 974
[1] 971 972 973 974 975
[1] 972 973 974 975 976
[1] 973 974 975 976 977
[1] 974 975 976 977 978
[1] 975 976 977 978 979
[1] 976 977 978 979 980
[1] 977 978 979 980 981
[1] 978 979 980 981 982
[1] 979 980 981 982 983
[1] 980 981 982 983 984
[1] 981 982 983 984 985
[1] 982 983 984 985 986
[1] 983 984 985 986 987
[1] 984 985 986 987 988
[1] 985 986 987 988 989
[1] 986 987 988 989 990
[1] 987 988 989 990 991
[1] 988 989 990 991 992
[1] 989 990 991 992 993
[1] 990 991 992 993 994
[1] 991 992 993 994 995
[1] 992 993 994 995 996
[1] 993 994 995 996 997
[1] 994 995 996 997 998
[1] 995 996 997 998 999
[1] 996 997 998 999 1000
[1] 997 998 999 1000 1001
[1] 998 999 1000 1001 1002
[1] 999 1000 1001 1002 1003
[1] 1000 1001 1002 1003 1004
[1] 1001 1002 1003 1004 1005
[1] 1002 1003 1004 1005 1006
[1] 1003 1004 1005 1006 1007
[1] 1004 1005 1006 1007 1008
[1] 1005 1006 1007 1008 1009
[1] 1006 1007 1008 1009 1010
[1] 1007 1008 1009 1010 1011
[1] 1008 1009 1010 1011 1012
[1] 1009 1010 1011 1012 1013
[1] 1010 1011 1012 1013 1014
[1] 1011 1012 1013 1014 1015
[1] 1012 1013 1014 1015 1016
[1] 1013 1014 1015 1016 1017
[1] 1014 1015 1016 1017 1018
[1] 1015 1016 1017 1018 1019
[1] 1016 1017 1018 1019 1020
[1] 1017 1018 1019 1020 1021
[1] 1018 1019 1020 1021 1022
[1] 1019 1020 1021 1022 1023
[1] 1020 1021 1022 1023 1024
[1] 1021 1022 1023 1024 1025
[1] 1022 1023 1024 1025 1026
[1] 1023 1024 1025 1026 1027
[1] 1024 1025 1026 1027 1028
[1] 1025 1026 1027 1028 1029
[1] 1026 1027 1028 1029 1030
[1] 1027 1028 1029 1030 1031
[1] 1028 1029 1030 1031 1032
[1] 1029 1030 1031 1032 1033
[1] 1030 1031 1032 1033 1034
[1] 1031 1032 1033 1034 1035
[1] 1032 1033 1034 1035 1036
[1] 1033 1034 1035 1036 1037
[1] 1034 1035 1036 1037 1038
[1] 1035 1036 1037 1038 1039
[1] 1036 1037 1038 1039 1040
[1] 1037 1038 1039 1040 1041
[1] 1038 1039 1040 1041 1042
[1] 1039 1040 1041 1042 1043
[1] 1040 1041 1042 1043 1044
[1] 1041 1042 1043 1044 1045
[1] 1042 1043 1044 1045 1046
[1] 1043 1044 1045 1046 1047
[1] 1044 1045 1046 1047 1048
[1] 1045 1046 1047 1048 1049
[1] 1046 1047 1048 1049 1050
[1] 1047 1048 1049 1050 1051
[1] 1048 1049 1050 1051 1052
[1] 1049 1050 1051 1052 1053
[1] 1050 1051 1052 1053 1054
[1] 1051 1052 1053 1054 1055
[1] 1052 1053 1054 1055 1056
[1] 1053 1054 1055 1056 1057
[1] 1054 1055 1056 1057 1058
[1] 1055 1056 1057 1058 1059
[1] 1056 1057 1058 1059 1060
[1] 1057 1058 1059 1060 1061
[1] 1058 1059 1060 1061 1062
[1] 1059 1060 1061 1062 1063
[1] 1060 1061 1062 1063 1064
[1] 1061 1062 1063 1064 1065
[1] 1062 1063 1064 1065 1066
[1] 1063 1064 1065 1066 1067
[1] 1064 1065 1066 1067 1068
[1] 1065 1066 1067 1068 1069
[1] 1066 1067 1068 1069 1070
[1] 1067 1068 1069 1070 1071
[1] 1068 1069 1070 1071 1072
[1] 1069 1070 1071 1072 1073
[1] 1070 1071 1072 1073 1074
[1] 1071 1072 1073 1074 1075
[1] 1072 1073 1074 1075 1076
[1] 1073 1074 1075 1076 1077
[1] 1074 1075 1076 1077 1078
[1] 1075 1076 1077 1078 1079
[1] 1076 1077 1078 1079 1080
[1] 1077 1078 1079 1080 1081
[1] 1078 1079 1080 1081 1082
[1] 1079 1080 1081 1082 1083
[1] 1080 1081 1082 1083 1084
[1] 1081 1082 1083 1084 1085
[1] 1082 1083 1084 1085 1086
[1] 1083 1084 1085 1086 1087
[1] 1084 1085 1086 1087 1088
[1] 1085 1086 1087 1088 1089
[1] 1086 1087 1088 1089 1090
[1] 1087 1088 1089 1090 1091
[1] 1088 1089 1090 1091 1092
[1] 1089 1090 1091 1092 1093
[1] 1090 1091 1092 1093 1094
[1] 1091 1092 1093 1094 1095
[1] 1092 1093 1094 1095 1096
[1] 1093 1094 1095 1096 1097
[1] 1094 1095 1096 1097 1098
[1] 1095 1096 1097 1098 1099
[1] 1096 1097 1098 1099 1100
[1] 1097 1098 1099 1100 1101
[1] 1098 1099 1100 1101 1102
[1] 1099 1100 1101 1102 1103
[1] 1100 1101 1102 1103 1104
[1] 1101 1102 1103 1104 1105
[1] 1102 1103 1104 1105 1106
[1] 1103 1104 1105 1106 1107
[1] 1104 1105 1106 1107 1108
[1] 1105 1106 1107 1108 1109
[1] 1106 1107 1108 1109 1110
[1] 1107 1108 1109 1110 1111
[1] 1108 1109 1110 1111 1112
[1] 1109 1110 1111 1112 1113
[1] 1110 1111 1112 1113 1114
[1] 1111 1112 1113 1114 1115
[1] 1112 1113 1114 1115 1116
[1] 1113 1114 1115 1116 1117
[1] 1114 1115 1116 1117 1118
[1] 1115 1116 1117 1118 1119
[1] 1116 1117 1118 1119 1120
[1] 1117 1118 1119 1120 1121
[1] 1118 1119 1120 1121 1122
[1] 1119 1120 1121 1122 1123
[1] 1120 1121 1122 1123 1124
[1] 1121 1122 1123 1124 1125
[1] 1122 1123 1124 1125 1126
[1] 1123 1124 1125 1126 1127
[1] 1124 1125 1126 1127 1128
[1] 1125 1126 1127 1128 1129
[1] 1126 1127 1128 1129 1130
[1] 1127 1128 1129 1130 1131
[1] 1128 1129 1130 1131 1132
[1] 1129 1130 1131 1132 1133
[1] 1130 1131 1132 1133 1134
[1] 1131 1132 1133 1134 1135
[1] 1132 1133 1134 1135 1136
[1] 1133 1134 1135 1136 1137
[1] 1134 1135 1136 1137 1138
[1] 1135 1136 1137 1138 1139
[1] 1136 1137 1138 1139 1140
[1] 1137 1138 1139 1140 1141
[1] 1138 1139 1140 1141 1142
[1] 1139 1140 1141 1142 1143
[1] 1140 1141 1142 1143 1144
[1] 1141 1142 1143 1144 1145
[1] 1142 1143 1144 1145 1146
[1] 1143 1144 1145 1146 1147
[1] 1144 1145 1146 1147 1148
[1] 1145 1146 1147 1148 1149
[1] 1146 1147 1148 1149 1150
[1] 1147 1148 1149 1150 1151
[1] 1148 1149 1150 1151 1152
[1] 1149 1150 1151 1152 1153
[1] 1150 1151 1152 1153 1154
[1] 1151 1152 1153 1154 1155
[1] 1152 1153 1154 1155 1156
[1] 1153 1154 1155 1156 1157
[1] 1154 1155 1156 1157 1158
[1] 1155 1156 1157 1158 1159
[1] 1156 1157 1158 1159 1160
[1] 1157 1158 1159 1160 1161
[1] 1158 1159 1160 1161 1162
[1] 1159 1160 1161 1162 1163
[1] 1160 1161 1162 1163 1164
[1] 1161 1162 1163 1164 1165
[1] 1162 1163 1164 1165 1166
[1] 1163 1164 1165 1166 1167
[1] 1164 1165 1166 1167 1168
[1] 1165 1166 1167 1168 1169
[1] 1166 1167 1168 1169 1170
[1] 1167 1168 1169 1170 1171
[1] 1168 1169 1170 1171 1172
[1] 1169 1170 1171 1172 1173
[1] 1170 1171 1172 1173 1174
[1] 1171 1172 1173 1174 1175
[1] 1172 1173 1174 1175 1176
[1] 1173 1174 1175 1176 1177
[1] 1174 1175 1176 1177 1178
[1] 1175 1176 1177 1178 1179
[1] 1176 1177 1178 1179 1180
[1] 1177 1178 1179 1180 1181
[1] 1178 1179 1180 1181 1182
[1] 1179 1180 1181 1182 1183
[1] 1180 1181 1182 1183 1184
[1] 1181 1182 1183 1184 1185
[1] 1182 1183 1184 1185 1186
[1] 1183 1184 1185 1186 1187
[1] 1184 1185 1186 1187 1188
[1] 1185 1186 1187 1188 1189
[1] 1186 1187 1188 1189 1190
[1] 1187 1188 1189 1190 1191
[1] 1188 1189 1190 1191 1192
[1] 1189 1190 1191 1192 1193
[1] 1190 1191 1192 1193 1194
B <- matrix(
c(2,3,4,1,5,98),
nrow=3,
ncol=2
)
B
[,1] [,2]
[1,] 2 1
[2,] 3 5
[3,] 4 98
t(B)
[,1] [,2] [,3]
[1,] 2 3 4
[2,] 1 5 98
C <- matrix(
c(7,4,2),
nrow = 3,
ncol = 1
)
C
[,1]
[1,] 7
[2,] 4
[3,] 2
BC <- cbind(B,C)
BC
[,1] [,2] [,3]
[1,] 2 1 7
[2,] 3 5 4
[3,] 4 98 2
c(B)
[1] 2 3 4 1 5 98
# rnorm(n, mean, sd)
# sample(x, size, replace = FALSE, prob = NULL)
ndist <- rnorm(100, 50, 10)
ndist
[1] 47.73035 57.45589 53.32819 38.75960 42.93869 42.72456 31.65686 45.92312 50.26861
[10] 59.11629 66.34346 50.60686 68.47573 50.80125 64.18556 64.58616 50.55877 34.82759
[19] 49.51421 47.85643 70.95818 52.02323 55.17724 66.78143 53.85245 37.18113 44.17849
[28] 67.74119 47.89328 46.47893 55.85172 60.13685 49.77431 40.96845 59.07773 61.61943
[37] 45.42047 59.27957 28.97065 33.22833 67.65656 57.94447 45.16130 69.28359 46.15884
[46] 34.13323 52.14302 38.61718 54.89414 32.47363 55.01017 50.86756 51.91074 58.31839
[55] 43.20968 52.95862 61.12166 53.62590 47.29085 48.03054 50.66955 41.32198 46.37994
[64] 38.60450 41.84629 63.10246 47.41639 56.06265 53.13448 50.53603 61.28254 44.41867
[73] 65.35959 49.37554 50.21575 29.10173 41.89111 20.56210 49.81204 46.45320 50.35570
[82] 54.94119 43.40192 60.01142 60.72084 57.55766 35.44535 59.42871 31.29725 47.46728
[91] 47.07438 52.18768 36.44931 48.77273 45.48135 50.97248 46.81898 44.16238 50.67285
[100] 53.55466
mean(ndist)
[1] 49.99382
sd(ndist)
[1] 10.0121
hist(ndist)
sample(ndist, 10)
[1] 47.07438 43.20968 52.18768 69.28359 50.60686 59.27957 46.37994 57.55766 65.35959
[10] 47.73035
test <- 1:100
test
[1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
[22] 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
[43] 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
[64] 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
[85] 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
sample(test, 50, replace = FALSE)
[1] 47 56 87 91 78 50 88 92 79 32 74 85 35 55 59 60 3 75 96 38 90 52
[23] 73 45 57 99 12 93 21 23 26 86 95 43 49 61 84 14 7 28 41 34 100 5
[45] 19 4 94 9 37 98
sample(test, 50, replace = TRUE)
[1] 8 86 90 46 62 78 75 12 84 4 61 94 85 42 80 7 22 46 51 21 82 58 15 92 40 44 54 45 13
[30] 95 24 98 64 92 3 71 96 19 63 1 76 85 4 34 65 21 73 72 95 46